/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ufps.cuatro.util.generadores.codeobject;

import java.util.ArrayList;

/**
 *
 * @author CATC
 */
public class CodeContextImport extends CodeContext{
    
    public final static String IMPORT = "import";
    private String strImport = "";
    private boolean single = true;

    public CodeContextImport() {
    }    

    public CodeContextImport(String strImport, boolean single) {
        this.strImport = strImport.trim();
        this.single = single;
    }

    public String getStrImport() {
        return strImport;
    }

    public void setStrImport(String strImport) {
        this.strImport = strImport.trim();
    }

    @Override
    public String toString() {        
        return strImport;
    }
    
    public ArrayList<String> getTokens(){
        return UtilCodeContext.getTokens(strImport, ".");
    }
    
    public String getDefinicion(Object obj) {
        if(!strImport.isEmpty()){
            return IMPORT + " " + strImport + ((!single) ? ".*;" : ";");
        }
        return "";
    }
}
